package com.zabra.zl.net;


import com.zabra.zl.data.AccountBean;
import com.zabra.zl.data.AllocationManageBean;
import com.zabra.zl.data.BankData;
import com.zabra.zl.data.BankListBean;
import com.zabra.zl.data.ClearBean;
import com.zabra.zl.data.DepositParmasBean;
import com.zabra.zl.data.DetailsDealBean;
import com.zabra.zl.data.LoginBean;
import com.zabra.zl.data.MoneyRuleBean;
import com.zabra.zl.data.MultipleRuleBean;
import com.zabra.zl.data.OrderListBean;
import com.zabra.zl.data.ProfitBean;
import com.zabra.zl.data.RechargeOffLineBean;
import com.zabra.zl.data.RechargeOnLineBean;
import com.zabra.zl.data.RunningListBean;
import com.zabra.zl.data.RunningTypeBean;
import com.zabra.zl.data.SimpleBean;
import com.zabra.zl.data.StockBean;
import com.zabra.zl.data.VerifyPersonBean;
import com.zabra.zl.data.WechatBean;

import io.reactivex.Flowable;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Create by zhenglei on 2019/06/17
 */
public interface APIService {
    String baseUrl = "zbfunding/";

    //获取验证码
    @POST(baseUrl + "debtor/registryGetCode")
    Flowable<SimpleBean> getCodeData(@Body RequestBody body);

    //用户注册
    @POST(baseUrl + "debtor/registry")
    Flowable<SimpleBean> getRegistData(@Body RequestBody body);

    //登录
    @POST(baseUrl + "debtor/login")
    Call<LoginBean> getLoginData(@Body RequestBody body);

    //密码找回获取验证码
    @POST(baseUrl + "debtor/forgetPwd")
    Flowable<SimpleBean> getForgetPwdCode(@Body RequestBody body);

    //验证验证码（未登录）
    @POST(baseUrl + "debtor/checkCodeOffLine")
    Flowable<SimpleBean> getVerityCodeNoLogin(@Body RequestBody body);

    //获取验证码（登录）
    @POST(baseUrl + "debtor/getCode")
    Call<SimpleBean> getVerCodeIsLogin(@Body RequestBody body);

    //验证验证码（登录）
    @POST(baseUrl + "debtor/checkCodeOnLine")
    Call<SimpleBean> getVerityCodeIsLogin(@Body RequestBody body);

    //修改登录密码（未登录）
    @POST(baseUrl + "debtor/updatePwdOffLine")
    Flowable<SimpleBean> getUpdatePwdNoLoginData(@Body RequestBody body);

    //修改登录密码（登录）
    @POST(baseUrl + "debtor/updatePwdOnLine")
    Flowable<SimpleBean> getUpdatePwdIsLoginData(@Body RequestBody body);

    //退出登录
    @POST(baseUrl + "debtor/quit")
    Flowable<SimpleBean> getLogoutData(@Body RequestBody body);

    //账户个人中心
    @POST(baseUrl + "debtor/userInfo")
    Call<AccountBean> getAccountData(@Body RequestBody body);

    //实名认证
    @POST(baseUrl + "debtor/attestation")
    Call<VerifyPersonBean> getVerifyPersonData(@Body RequestBody body);

    //银行卡列表
    @POST(baseUrl + "debtorBank/bankCardList")
    Call<BankListBean> getBankListData(@Body RequestBody body);

    //卡号获取银行
    @POST(baseUrl + "debtorBank/getBankName")
    Call<BankData> getBankData(@Body RequestBody body);

    //绑定银行卡
    @POST(baseUrl + "debtorBank/bind")
    Flowable<SimpleBean> getBindBankData(@Body RequestBody body);

    //设置交易密码
    @POST(baseUrl + "debtor/updateTranPwd")
    Call<SimpleBean> getDealPwdData(@Body RequestBody body);

    //解绑银行卡
    @POST(baseUrl + "debtorBank/unBind")
    Call<SimpleBean> getUnBindBankData(@Body RequestBody body);

    //资金流水类型
    @POST(baseUrl + "debtorBank/busiTypes")
    Call<RunningTypeBean> getRunningTypeData();

    //资金流水列表
    @POST(baseUrl + "debtorBank/fundFlow")
    Call<RunningListBean> getRunningListData(@Body RequestBody body);

    //配资管理列表
    @GET(baseUrl + "bpOrder/findBpOrderList")
    Call<AllocationManageBean> getAllocationManageListData(@Query("bpStatus") String bpStatus,
                                                           @Query("bpType") String bpType,
                                                           @Query("currentPage") String currentPage,
                                                           @Query("itemsPerPage") String itemsPerPage);

    //追加保证金
    @GET(baseUrl + "bpOrder/addBpOrderGuaranteeAmt")
    Call<SimpleBean> getAddCashData(@Query("bpOrderId") int bpOrderId,
                                    @Query("money") String money);

    //终止交易
    @GET(baseUrl + "bpOrder/terminateBpOrder")
    Call<SimpleBean> getOverDealData(@Query("bpOrderId") int bpOrderId);

    //去交易详情
    @POST(baseUrl + "bpOrder/bpOrderDetail")
    Call<DetailsDealBean> getDetailsDealData(@Body RequestBody body);

    //配资金额规则查询
    @GET(baseUrl + "bpOrder/findBpSetList")
    Call<MoneyRuleBean> getMoneyRuleData(@Query("bpType") int bpType);

    //配资杠杆规则查询
    @GET(baseUrl + "bpOrder/finBbpList")
    Call<MultipleRuleBean> getMultipleRuleData(@Query("bpType") int bpType);

    //申请配资
    @GET(baseUrl + "bpOrder/saveBpOrder")
    Call<SimpleBean> getSubmitAllocationData(@Query("guaranteeAmt") String guaranteeAmt,
                                             @Query("bpId") int bpId,
                                             @Query("times") int times,
                                             @Query("bpType") int bpType,
                                             @Query("singleRate") String singleRate,
                                             @Query("bpAround") int bpAround,
                                             @Query("bpTimeType") int bpTimeType);

    //提现界面参数
    @POST(baseUrl + "transOrder/withdrawParam")
    Call<DepositParmasBean> getDepositParmasData(@Body RequestBody body);

    //提现(线上)  withdrawOffLineAddOrder线下
    @POST(baseUrl + "transOrder/withdrawOnLineAddOrder")
    Call<SimpleBean> getDepositData(@Body RequestBody body);

    //股票查询信息
    @GET(baseUrl + "comOrder/findQuoteList")
    Flowable<StockBean> getStockData(@Query("sharesCode") String sharesCode,
                                     @Query("bpOrderId") int bpOrderId);

    //可提盈查询
    @GET(baseUrl + "comOrder/findProfit")
    Call<ProfitBean> getProfitData(@Query("bpOrderId") int bpOrderId);

    //提盈
    @GET(baseUrl + "comOrder/saveProfit")
    Call<SimpleBean> getSubmitProfitData(@Query("bpOrderId") int bpOrderId,
                                         @Query("profitAmt") String profitAmt);

    //买入股票
    @GET(baseUrl + "comOrder/tradeShareBuy")
    Call<SimpleBean> getBuyStockData(@Query("sharesCode") String sharesCode,
                                     @Query("sharesName") String sharesName,
                                     @Query("entrustPrice") String entrustPrice,
                                     @Query("entrustNum") String entrustNum,
                                     @Query("entrustProportion") String entrustProportion,
                                     @Query("bpOrderId") String bpOrderId);

    //卖出股票
    @GET(baseUrl + "comOrder/tradeShareSell")
    Call<SimpleBean> getSaleStockData(@Query("sharesCode") String sharesCode,
                                      @Query("sharesName") String sharesName,
                                      @Query("entrustPrice") String entrustPrice,
                                      @Query("entrustNum") String entrustNum,
                                      @Query("entrustProportion") String entrustProportion,
                                      @Query("bpOrderId") String bpOrderId,
                                      @Query("bpFundsRId") String bpFundsRId);

    //获取订单列表  1委托撤单、2当日委托、3历史委托、 4当日成交、5历史成交
    @GET(baseUrl + "comOrder/findComOrderList")
    Call<OrderListBean> getOrderListData(@Query("dealStatus") int dealStatus,
                                         @Query("bpOrderId") int bpOrderId,
                                         @Query("startTime") String startTime,
                                         @Query("endTime") String endTime);

    //撤单
    @GET(baseUrl + "comOrder/repealComOrder")
    Call<SimpleBean> getRecallOrderData(@Query("comOrderId") int comOrderId,
                                        @Query("bpOrderId") int bpOrderId);

    //清仓查询
    @GET(baseUrl + "comOrder/getClearDebtorShares")
    Call<ClearBean> getClearData(@Query("bpOrderId") int bpOrderId);

    //线上转账参数
    @POST(baseUrl + "transOrder/transferOnLineAddOrder")
    Call<RechargeOnLineBean> getOnLineData(@Body RequestBody body);

    //线下转账参数
    @POST(baseUrl + "transOrder/transferOffLineParam")
    Call<RechargeOffLineBean> getOffLineData(@Body RequestBody body);

    //线下转账提交
    @POST(baseUrl + "transOrder/transferOffLineAddOrder")
    Call<SimpleBean> getOffLineSubmitData(@Body RequestBody body);

    //线下微信充值获取二维码
    @POST(baseUrl + "transOrder/wechatPayOffLineParam")
    Call<WechatBean> getWeChatData(@Body RequestBody body);

    //线下微信充值提交
    @POST(baseUrl + "transOrder/wechatPayOffLineAddOrder")
    Call<SimpleBean> getWeChatSubmitData(@Body RequestBody body);

    //线下支付宝充值获取二维码
    @POST(baseUrl + "transOrder/alipayOffLineParam")
    Call<WechatBean> getAlipayData(@Body RequestBody body);

    //线下支付宝充值提交
    @POST(baseUrl + "transOrder/alipayOffLineAddOrder")
    Call<SimpleBean> getAlipaySubmitData(@Body RequestBody body);
}
